package com.ehotting.edsta.diagnosisPredict.feign.factory;

import com.ehotting.eaf.core.web.domain.diagnosisPredict.Response;
import com.ehotting.edsta.diagnosisPredict.domain.dto.FeDatafield;
import com.ehotting.edsta.diagnosisPredict.domain.dto.FeDatafile;
import com.ehotting.edsta.diagnosisPredict.feign.FeDatafileFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 特征工程原始数据文件的降级处理
 * 
 * @author edsta
 */
@Slf4j
@Component
public class FeDatafileFallbackFactory implements FallbackFactory<FeDatafileFeignService> {

    @Override
    public FeDatafileFeignService create(Throwable throwable)
    {
        log.error("特征工程原始数据文件调用失败:{}", throwable.getMessage());
        return new FeDatafileFeignService() {
            @Override
            public Response<List<FeDatafield>> uploadAnalyze(Long equipentityId, MultipartFile file, String fileDesc, Long iteminfoId, String itemname, Long processingId, Integer txtMethod) {
                return null;
            }

            @Override
            public Response<FeDatafile> analyzeSave(Long id) {
                return null;
            }
        };
    }
}
